package src.manager
{
	import flash.filters.BitmapFilter;
	import flash.filters.BitmapFilterQuality;
	import flash.filters.ColorMatrixFilter;
	import flash.filters.GlowFilter;
	
	/**
	 * 濾鏡管理類
	 * @author Anjue
	 */
	public class FilterManager
	{
		public function FilterManager()
		{
		}
		
		/**
		 * 創建發光濾鏡
		 * @param color 光晕颜色
		 * @param alpha 颜色的 Alpha 透明度值
		 * @param blurX 水平模糊量
		 * @param blurY 垂直模糊量
		 * @param strength 印记或跨页的强度
		 * @param inner 指定发光是否为内侧发光
		 * @param knockout 指定对象是否具有挖空效果
		 * @return 
		 */
		public static function getGrowFilter(color:Number=0xFF0000,alpha:Number=1.0,blurX:Number=3,blurY:Number=3,strength:Number=100,inner:Boolean=false,knockout:Boolean=false):BitmapFilter
		{
            var quality:Number = BitmapFilterQuality.LOW;
            return new GlowFilter(color,
                                  alpha,
                                  blurX,
                                  blurY,
                                  strength,
                                  quality,
                                  inner,
                                  knockout);
		}
		
		public static function getGrayFilter():ColorMatrixFilter
		{
			var mat:Array =[0.3086,0.6094,0.082,0,0,0.3086,0.6094,0.082,0,0,0.3086,0.6094,0.082,0,0,0,0,0,1,0];
			var colorMat:ColorMatrixFilter = new ColorMatrixFilter(mat);
			return colorMat;
		}
	}
}